The present invention relates to updating electronic documents, and more specifically, to updating hierarchically structured electronic documents stored in databases. There are numerous types of electronic documents that are used in various computer applications. Often these documents have a hierarchical structure. One example of a hierarchically structured document is an Extensible Markup Language (XML) document.
As hierarchically structured data, such as XML documents become widely used as a data format, it also becomes a native data type for database systems. One example of a database system is the DB2 Enterprise Server Edition, which is a relational model database server developed by International Business Machines Corporation of Armonk, N.Y. The storage of hierarchically structured data in relational databases such as the DB2, however, poses various challenges.
One such challenge relates to updating an XML document. The updates may involve operations, such as deleting nodes and sub-trees, thus reducing the data. The updates may involve inserting nodes and sub-trees, thus expanding the data, and possibly growing the data into multiple records. The updates may involve replacing nodes, which may result in either expanding or reducing data, depending on the nature of the data to be updated. In addition, XML indexes need to be maintained for all updates.